{include file="header.tpl.php"}


<div class="titleFull">

	<div class="wrapper">

		<h1 style="line-height: 100px; margin: 0px;">Statistics</h1>

	</div>

</div>


<div class="titleBlueBar"></div>




<div class="content2">

	<div class="wrapper">

		<div class="h30"></div>

		<div class="boxLeft2">





				<!--Date Pickers-->
				<form action="stats.php" method="post">

				<table cellspacing="0" style="font-size:13px; width:670px;" class="datearea">
				<tr>
					<td style="width:80px;">Start Date</td> <td><input style="width: 190px;" type="text" name="date1" id="date1" /></td>  <td style="text-align:center; width:85px">End Date</td> <td><input style="width: 190px;" type="text" id="date2" name="date2" /></td><td>&nbsp;<input type="submit" class="buttonsmall" value="View" name="submit" style="vertical-align: top;" /></td>
				</tr>
				</table>

				</form>
				<!--End Date Picker-->

				<script type="text/javascript">
				var today = '{$serverDate}';

				{literal}
				$(document).ready(function(){

				 $('#date1').datepicker({ dateFormat: "yy-mm-dd"});
				 $('#date1').datepicker( "option", "defaultDate", today );
				 $('#date2').datepicker({ dateFormat: "yy-mm-dd"}); 
				 $('#date2').datepicker( "option", "defaultDate", today );

					
				});

				{/literal}
				</script>


				<p style="color:#56565f; margin:10px auto;">{if $date_start ne ""}Showing Statistics From &nbsp;| {$date_start} {/if}{if $date_end ne ""}- {$date_end}{/if} </p>

				 
				<br>
				<h3>CLICKS/DOWNLOADS</h3>
				<div id="a_chart" style="width:668px;  margin:10px 0;   border:1px solid #bbbbbb;">
				{if $ldata eq "" || $ldata|@count lt 1}
				<br />
				<center>Files analytics not available</center>
				{/if}
				</div>



				<br />
				<h3>COUNTRY BREAKDOWN</h3>
				<div id="c_map" style="width:668px;  margin:10px 0; border:1px solid #bbbbbb;">
				{if $country_analytics eq "" || $country_analytics|@count lt 1}
				<br />
				<center>country breakdown not available</center>
				{/if}
				</div>


				<br>
				<h3>PREMIUM EARNINGS</h3>
				<div id="premium_chart" style="width:668px;  margin:10px 0;  border:1px solid #bbbbbb;">
				{if $pdata eq "" || $pdata|@count lt 1}
				<br />
				<center>Premium earnings chart not available</center>
				{/if}
				</div>


				<br>
				<h3>REFERRERS</h3>
				<table class="table" cellpadding="0" cellspacing="0">
					<tr">
						<th colspan="2">Referrer</th>
						<th>Downloads</th>
				   </tr>


					 {if $referrers ne ""}
					
					{foreach item=ref from=$referrers}
					<tr>

					<td colspan="2">{$ref.referrer}</td>
					<td ><b>{$ref.count}</b> Downloads</td>

					</tr>
					{/foreach}
				   
					{else}
					 <tr style="text-align:center"><td colspan="3">No referrers found.</td></tr>
					
					{/if}
					
				</table>




				<br />
				<h3>DETAILED STATISTICS</h3>
				<table class="table" cellpadding="0" cellspacing="0">
					<tr>
						<th>File ID</th>
						<th>Revenue</th>
						<th>Downloads</th>
						<th>Clicks</th>
						<th>Conv</th> 
						<th>AvgCPA</th>         
					    <th>EPC</th>
					</tr>


					{if $history ne "" && $history|@count gt 0}
					
					{foreach item=data from=$history}
					<tr>
					<td><span  title="{$data.file}" class="ec-tip-twitter">{$data.id}</span></td>
					<td>${$data.profit}</td>
					<td >{$data.downloads}</td>
					<td>{$data.clicks}</td>
					<td>{$data.conv}%</td>
					<td>${$data.avgcpa}</td>    
					<td>${$data.epc}</td> 
					</tr>
					{/foreach}
					<tr style=" font-weight:bold;">
					<td>&nbsp;Total/Average</td>
					<td>${$total_profit}</td>
					<td >{$total_downloads}</td>
					<td>{$total_clicks}</td>
					<td>{$total_conv}%</td>
					<td>${$total_avg}</td>    
					<td>${$total_epc}</td>
					</tr>       
					{else}
					 <tr style="text-align:center"><td colspan="7">Files Aanlytics Not Available.</td></tr>
					
					{/if}
					
				 

				</table>




				<br />
				<h3>GATEWAYS STATS</h3>
				<table class="table" cellpadding="0" cellspacing="0">
					<tr>
						<th>Gateway</th>
						<th>Revenue</th>
						<th>Unlocks</th>
						<th>Clicks</th>
						<th>Conv</th> 
						<th>AvgCPA</th>         
						<th>EPC</th>
					</tr>


					{if $gw_data ne "" && $gw_data|@count gt 0}
					
					{foreach item=data from=$gw_data}
					<tr>
					<td><span  title="{$data.gw_name}" class="ec-tip-twitter">{$data.gw_name}</span></td>
					<td>${$data.profit}</td>
					<td >{$data.downloads}</td>
					<td>{$data.clicks}</td>
					<td>{$data.conv}%</td>
					<td>${$data.avgcpa}</td>    
					<td>${$data.epc}</td> 
					</tr>
					{/foreach}
					<tr style=" font-weight:bold;">
					<td>&nbsp;Total/Average</td>
					<td>${$gtotal_profit}</td>
					<td >{$gtotal_downloads}</td>
					<td>{$gtotal_clicks}</td>
					<td>{$gtotal_conv}%</td>
					<td>${$gtotal_avg}</td>    
					<td>${$gtotal_epc}</td>
					</tr>       
					{else}
					 <tr style="text-align:center"><td colspan="7">Gateways Aanlytics Not Available.</td></tr>
					
					{/if}
					
				 

				</table>





		</div>


<!--Right Panel-->
{include file="sidebar.tpl.php"}
<!--End Right Panel-->


{include file="footer.tpl.php"}